import peewee as pw

from apiCenter.src.lib.Model import BaseModel, DefaultCols


class DbUser(BaseModel, DefaultCols):
    id = pw.PrimaryKeyField()
    f_account = pw.CharField(max_length=100, verbose_name='用户账户')
    f_nick = pw.CharField(max_length=120, verbose_name='用户昵称')
    f_email = pw.CharField(null=True, max_length=120, verbose_name='用户邮箱')
    f_password = pw.TextField(null=True, verbose_name='用户密码')
    b_is_admin = pw.IntegerField(default='2', verbose_name='是否为超级管理员')

    class Meta:
        table_name = 'sys_user'
